package com.ki.controller;

import com.ki.rent.service.AdminService;
import com.ki.rent.service.UserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class LoginController {

    private UserService userService;


    @Autowired
    private AdminService adminService;
    @RequestMapping("/toLogin")
    public String index(){
        return "login";
    }

    @RequestMapping("/index")
    public String toIndex(){
        System.out.println("aaa");
        return "index";
    }

    //跳转注册页面
    @RequestMapping("/add")
    public String zhuCe(){
        return "html/addUser";
    }

    @RequestMapping("/AddUser")
    public String adminLogin(@RequestParam("account") String account,
                           @RequestParam("password") String password,
                           Model model){
                return "redirect:/index";
    }

    @RequestMapping("newLogin")
    public String toNew(){
        return "login";
    }

    @RequestMapping("/toMain")
    public String main(){
        return "login";
    }

}
